<template>
      <el-link  v-for="(item,index) in list" :key="index" :href="item.data" rel="external nofollow"  type="primary" target="_blank">{{ item.config }}&nbsp;&nbsp;|&nbsp;&nbsp;</el-link>
</template>

<script>
import {onMounted, reactive, ref, toRefs} from 'vue'
import {getModelsDataCondition} from '../api/model'
export default {
  name: 'HrefList',
  setup() {
    const state = reactive({
      list: []
    })
    // 调取api获取数据
    const getList = () => {
      var params = {
      }
      getModelsDataCondition("models",params).then(res => {
        console.log("==========================================================")
        console.log(res.data)
        state.list = res.data
      })
    }
    onMounted(getList)
    // ...toRefs()将state里面得对象解构
    return {
      ...toRefs(state),
    };
  },
};
</script>

<style scoped>

</style>
